if (typeof window !== 'undefined') {
  window.addEventListener('error', function(e) {
    if (e.message.includes('Receiving end does not exist')) {
      e.stopPropagation();
      return true;
    }
  }, true);
}

import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import { 
  Tabbar,
  TabbarItem,
  NavBar,
  Search,
  Swipe,
  SwipeItem,
  Grid,
  GridItem,
  List,
  Cell,
  Sidebar,
  SidebarItem,
  Image as VanImage,
  CellGroup,
  Badge
} from 'vant'
import 'vant/lib/index.css'

const app = createApp(App)

// 注册组件
app.use(Tabbar)
   .use(TabbarItem)
   .use(NavBar)
   .use(Search)
   .use(Swipe)
   .use(SwipeItem)
   .use(Grid)
   .use(GridItem)
   .use(List)
   .use(Cell)
   .use(Sidebar)
   .use(SidebarItem)
   .use(VanImage)
   .use(CellGroup)
   .use(Badge)
   .use(router)

app.mount('#app')
